import { defineStore } from 'pinia';
import dayjs from "dayjs";

export default defineStore({
    id: 'hotel',
    state: () => ({
        beginDate: dayjs().format('YYYY-MM-DD'),
        endDate: dayjs().add(1,'day').format('YYYY-MM-DD'),
		dayCount:'1',
		firstweek:'',
		lastweek:''
    }),
    getters: {
        getbeginDate(): string {
            return this.beginDate;
        },
        getendDate(): string {
            return this.endDate;
        },
    },
    actions: {
        setbeginDate(newDate?: string) {
			// console.log('0000',newDate);
            this.beginDate = newDate || '';
        },
        setendDate(newDate?: string) {
            this.endDate = newDate || '';
			// console.log('8888',newDate);
        },
        setdayCount(newDate?: string) {
            this.dayCount = newDate || '';
			// console.log('dayCount',newDate);
        },
        setfirstweek(newDate?: string) {
            this.firstweek = newDate || '';
			// console.log('firstweek',newDate);
        },
        setlastweek(newDate?: string) {
            this.lastweek = newDate || '';
			// console.log('lastweek',newDate);
        },
    },
});
